package explorer.abstractFactory;

import java.util.Observable;

import explorer.abstractFactory.interfaces.IFolderIcon;
import explorer.abstractFactory.interfaces.IImageIcon;
import explorer.abstractFactory.interfaces.IMusicIcon;
import explorer.abstractFactory.interfaces.INullIcon;
import explorer.abstractFactory.interfaces.ITextIcon;
import explorer.abstractFactory.interfaces.IUndoIcon;
import explorer.abstractFactory.interfaces.IVideoIcon;

public class ProxyFactoryLoader extends Observable implements IAbstractFactory {

	private IAbstractFactory factory;
	
	
	public ProxyFactoryLoader(IAbstractFactory factory) {
		super();
		this.factory = factory;
	}

	
	public void setFactory(IAbstractFactory factory){
		
		this.factory=factory;
		update();
		
	}
	
	@Override
	public ITextIcon createTextIcon() {
		// TODO Auto-generated method stub
		return factory.createTextIcon();
	}

	@Override
	public IFolderIcon createFolderIcon() {
		// TODO Auto-generated method stub
		return factory.createFolderIcon();
	}

	@Override
	public IMusicIcon createMusicIcon() {
		// TODO Auto-generated method stub
		return factory.createMusicIcon();
	}

	@Override
	public IUndoIcon createUndoIcon() {
		// TODO Auto-generated method stub
		return factory.createUndoIcon();
	}

	@Override
	public IImageIcon createImageIcon() {
		// TODO Auto-generated method stub
		return factory.createImageIcon();
	}

	@Override
	public INullIcon createNullIcon() {
		// TODO Auto-generated method stub
		return factory.createNullIcon();
	}

	@Override
	public IVideoIcon createVideoIcon() {
		// TODO Auto-generated method stub
		return factory.createVideoIcon();
	}

	public void update(){
		setChanged();
		notifyObservers();
	}
}
